-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add akka.hosting #148
Add akka.hosting #148
Conversation
@Arkatufus : I think it looks great and you did some nice improvements here. I have only one concent and that's about the following comment I put on my draft PR: Or was this an issue because I did wire up the healthcheck actors myself instead of using the ActorExtension for that? |
If you could create a beta package for this, I could test this in our solution and see if this works as expected. |
That is a bit problematic since the persistence healthcheck supossed to check that the current node can actually access the backend storage and properly read-write from it and not coupled with clustering/remoting. I think it is better if we change the persistence id instead, tying it to the current cluster node. Problem with this approach is to figure out a way to create a unique persistence id that is guaranteed to not collide with anything else that is trying to access the storage backend. |
That's indeed also a good solution. Right now this is the persistenceId: https://github.com/petabridge/akkadotnet-healthcheck/blob/dev/src/Akka.HealthCheck.Persistence/AkkaPersistenceLivenessProbe.cs#L175 Can we not append the nodeIP to that if the node is part of an Akka.Cluster? I think you're safe then. |
You only then need to make sure that you not only remove latest -1 snapshot and messages but all messages because if nodes leave/join the cluster this might become an unexpected mess of orphaned data. |
Well, if we make sure that every incarnation of the probe have unique persistence ids, there won't be any mess because each of them would have their own snapshots |
|
I guess we can use |
That's correct. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have some minor cleanup to do - but let's merge this in, make available to users, get some feedback. Can you also make a separate PR with installation / configuration steps for IHealthCheck
integration?
_livenessStatus = livenessStatus; | ||
var selfMember = _cluster.State.Members.FirstOrDefault(m => m.Address == _cluster.SelfAddress); | ||
var isUp = selfMember is { Status: MemberStatus.Up or MemberStatus.WeaklyUp }; | ||
_livenessStatus = isUp ? new LivenessStatus(true) : DefaultClusterLivenessStatus; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
{ | ||
public static class AkkaHostingExtensions | ||
{ | ||
public static IServiceCollection WithAkkaHealthCheck(this IServiceCollection services) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds the ASP.NET healthchecks (IHealthCheck
)
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Akka.Cluster.Hosting" Version="0.5.1" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should derive from common.props
/ Directory.Build.props
|
||
namespace Akka.HealthCheck.Hosting.Services | ||
{ | ||
public class AkkaReadinessService : IHealthCheck |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ought to add some XML-DOC here
@@ -0,0 +1 @@ | |||
hit2%System.String, System.Private.CoreLib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably exclude this file from git
@Arkatufus guess we just need to address the comments on the review in order to merge + release this? |
@Arkatufus is this ready for review? |
No, not yet, sorry, was busy with Akka.Hosting. |
The persistence healthcheck is still problematic, i'm implementing it with GUID here, and the healthcheck will litter the database with random healthcheck data since the id is generated on each healhtcheck actor instantiation |
it wasn't a problem before because it will use the same id over and over, since we can't find a per actor discriminator that can survive actor/actor system restart, this could be a problem... |
We can't use a static counter because there is no guarantee that other nodes would not have another healthcheck running, creating an id collision |
an ideal solution would be to have a persisted unique id for each actor system node without relying on clustering |
# Conflicts: # src/common.props
@Arkatufus let me know when this is ready to take out of draft stage |
@Aaronontheweb This should be ready for review now |
The GUID problem is still unresolved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - need to validate the nuget publication locally (or check what the build server produced.) Don't want to publish any sample projects and need to make sure that the correct README.md
files are included.
@@ -0,0 +1,181 @@ | |||
# Akka.HealthCheck.Hosting.Web |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure this README is what ends up inside the Akka.HealthCheck.Hosting.Web
NuGet package when it's pushed. Include some of the other boilerplate about Akka.NET and Akka.Hosting that a user might need to know too.
This is an expansion of #146 with added Akka.Hosting support